package com.dubbo.consumer;

import com.dubbo.dubbo.demo.IHelloService;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

@EnableDubbo(scanBasePackages = "com.dubbo.consumer.Annotation")
@EnableHystrix
@SpringBootApplication
public class ConsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConsumerApplication.class, args);
    }

}

/*spring启动方式*/
/*public class ConsumerApplication {
    public static void main(String[] args) throws IOException {

        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("META-INF/Spring/consumer.xml");
        context.start();
        IHelloService providerService = (IHelloService) context.getBean("IHelloService");
        String str = providerService.helloBoy("xujk");
        System.out.println(str);
        System.in.read();

    }
}*/
